<?php
$pathArr = explode("/", $_SERVER["PHP_SELF"]);
$contextPath = $pathArr[1];
$rootPath = $_SERVER["DOCUMENT_ROOT"];
?>
<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>Admin Panel</title>
		<?php
			require_once($rootPath . "/" . $contextPath . "/includes/css_inc.php");
			require_once($rootPath . "/" . $contextPath . "/includes/js_inc.php");
		?>
		<script>
			$(function() {
				$( "button, input:submit, input:button, a", ".btn" ).button();

				$( "#dialog-login" ).dialog({
					autoOpen: true,
					height: 150,
					width: 300,
					modal: true,
					draggable: false,
					resizable: false,
					closeOnEscape: false,
					open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); }
				});
				$("#register").click(function(){
					window.location = "home.php";
				});
			});
		</script>
	</head>
	<body>
		<div id="dialog-login" title="ล๊อกอิน">
			<form action="actions/login.php" method="post">
					<input type="hidden" name="mode" value="chk_login" />
                     <table width="100%" cellpadding="2" cellspacing="2" border="0">
						<tr>
							<td width="20%" align="right">Username</td>
							<td><input type="text" name="login_name" size="30" /></td>
						</tr>
						<tr>
							<td align="right">Password</td>
							<td><input type="password"  name="password" size="30" /></td>
						</tr>
						<tr>
							<td colspan="2" align="right"><div class="btn"><input type="submit" value="Login"/>
							<input type="button" value="Register" id="register" /></div></td>
						</tr>
					</table>
			</form>
		</div>
	</body>
</html>